package io.zrpc.core.exception;

public class ZRpcException extends RuntimeException {

    /**
     * 异常类型
     */
    protected int errorType = RpcErrorType.UNKNOWN;

    protected ZRpcException() {
    }

    public ZRpcException(int errorType, String message) {
        super(message);
        this.errorType = errorType;
    }

    public ZRpcException(int errorType, Throwable cause) {
        super(cause);
        this.errorType = errorType;
    }

    public ZRpcException(int errorType, String message, Throwable cause) {
        super(message, cause);
        this.errorType = errorType;
    }

    public int getErrorType() {
        return errorType;
    }

    @Deprecated
    public ZRpcException(String message) {
        super(message);
    }

    @Deprecated
    public ZRpcException(String message, Throwable t) {
        super(message, t);
    }
}
